package Dao.impl;

import Dao.BaseDao;
import Dao.MusicBoxDAO;
import pojo.MusicBox;

import java.util.List;

public class MusicBoxDAOImpl extends BaseDao<MusicBox> implements MusicBoxDAO {
    @Override
    public List<MusicBox> getSongRequestDetails(int recipientId, int pageNum, int pageSize) {
        String sql = "SELECT mb.musicBoxId as musicBoxId,\n" +
                "       s.songId      as songId,\n" +
                "       s.title       AS songName,\n" +
                "       s.description AS songDescription,\n" +
                "       s.categoryId  AS songCategory,\n" +
                "       s.filePath    AS uploadPath\n" +
                "FROM MusicBoxes mb\n" +
                "         JOIN Songs s ON mb.songId = s.songId\n" +
                "WHERE mb.userId = ?\n" +
                "limit ?, ?";
        return getBeanList(sql, recipientId, pageNum, pageSize);

    }
}
